use serde_json::json;
use hello_macro::HelloMacro;
use hello_macro_derive::{HelloMacro};
use json_parse::serde_for_json;

#[derive(HelloMacro)]
struct Pancakes;

struct MyStruct {
    name: String,
    age: i32,
}

#[serde_for_json]
struct MyStruct {
    name:String,
    age:i32,
}

macro_rules! str_add {
    ($( $e :expr),*) => {
        {
            let mut  v=Vec::new();
            $ (
            v.push (format!("{}",$e));
            ) *
            v
        }
    };
}

fn main() {
    Pancakes::hello_macro();

    let my_struct = MyStruct {
        name: "Alice".to_string(),
        age: 25,
    };
    let json_str = my_struct.to_json();
    println!("JSON string: {}", json_str);
    // ————————————————
    // 原文链接：https://blog.csdn.net/qq_51553982/article/details/130434712

    let s=str_add![1,"a","true",3.14159f32];
    print!("{:?}",s);
    for a in &s{
        println!("item=>{}",&a);
    }
}

